import React, {Component} from 'react';
import './index.less';

import {deepClone} from 'nc-lightapp-front';

class JobHisModal extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const {modal, table, meta, showHistoryTable, json} = this.props;
        const {createModal} = modal;
        const {createSimpleTable} = table;
        //let template = meta.getMeta();

        //template['hi_psnjob_history_down'] = deepClone(template['hi_psnjob_history']);

        const jobHistory = (that) => {
            return (
                <div>
                    <div
                        className={'history-box'}
                    >
                        <div className="history-title">{json['hi6007-000192']}</div>
                        {createSimpleTable('hi_psnjob_history', {
                            cancelCustomRightMenu: true,
                        })}
                    </div>
                    {
                        showHistoryTable &&
                        <div className="history-box">
                            <div className="history-title">{json['hi6007-000193']}</div>
                            {createSimpleTable('hi_psnjob_history_down', {
                                cancelCustomRightMenu: true,
                            })}
                        </div>
                    }

                </div>
            )
        };
        return (
            <div>
                {
                    createModal('jobHistory', {
                        title: json['hi6007-000047'], /* 国际化处理： 任职历史*/
                        content: jobHistory.call(this),
                        size: 'xlg'
                    })
                }
            </div>
        );
    }
}

export default JobHisModal;
